﻿#ifndef TOOL_H
#define TOOL_H

typedef unsigned char BOOL;
#define TRUE 1
#define FALSE 0
void tool_string_insert(char* srcStr,
                        const unsigned short index,
                        const char* str);
BOOL tool_string_equal(const char str_1[],
                       const char str_2[]);
BOOL tool_string_equal_len(const char str_1[],
                           const char str_2[],
                           const unsigned short len);
short tool_string_indexOf(const char srcStr[],
                          const unsigned short srcStrLen,
                          const char tarStr[],
                          const unsigned short tarStrLen);

void tool_string_split_index(const char srcStr[],
                             const char spiltFlag,
                             const unsigned char index,
                             char tarStr[]);
unsigned short tool_string_split(const char srcStr[],
                                 const char spiltFlag,
                                 const unsigned short tarStrArrDep,
                                 const unsigned short tarStrArrLen,
                                 char* tarStrArr);
void tool_byteArray_copy(char* srcStr,
                      const char* copiedStr,
                      const unsigned short copiedStrLen);
char* tool_byteArray_append(char* srcStr,
                         const unsigned short srcLen,
                         const char* addedStr,
                         const unsigned short addedStrLen);
unsigned short tool_twoCharToShort(const char char_h,
                                   const char char_l);
void tool_ShortToTwoChar(const short value,
                         char *char_h,
                         char *char_l);
void tool_string_charToHexChar(char srcChar,
                               char* tarChar_h,
                               char* tarChar_l);
void tool_string_byteArrToHexStr(const char* srcStr,
                                 const unsigned short len,
                                 char* tarStr);
void tool_string_hexCharToChar(char srcChar_h,
                               char srcChar_l,
                               char* tarChar);
void tool_string_hexStrToByteArr(const char* srcHexStr,
                                 char* tarByteArr);
BOOL tool_string_numToStr(const short num,
                          char* str);
BOOL tool_string_strToNum(const char* str,
                          unsigned short* num);
#endif
